iT邦幫忙

2024 iThome 鐵人賽

DAY 11
0
佛心分享-IT 人自學之術

從0開始的ABAP之旅 系列 第 11

Day 11 工程師每日任務 ABAP中的Debug介紹

  • 分享至 

  • xImage
  •  

Hi 大家好
今天要來介紹ABAP中的Debug方法,

先進到我們要debug的程式中
然後在打t-code的地方打/h
之後按enter
https://ithelp.ithome.com.tw/upload/images/20240925/20169147ThvQMLc8vf.png

https://ithelp.ithome.com.tw/upload/images/20240925/20169147Lf4rcLbXes.png
看到左下角跳出debugging swith on
就代表成功開啟debug模式

再來就輸入我們要傳入的參數然後按小時鐘執行就可以進到debug頁面了
https://ithelp.ithome.com.tw/upload/images/20240925/201691479XpSFFoyOa.png

https://ithelp.ithome.com.tw/upload/images/20240925/20169147P3ViSKQfL4.png
進來後可以看到,左邊是我們的程式碼;右邊是各種變數與table

Debug模式中的按紐

https://ithelp.ithome.com.tw/upload/images/20240925/20169147QLo1qoCXVV.png
先來講上方的四個按紐

  • 1.single step:逐行執行
  • 2.execute :跟逐行執行的差別是execute遇到執行子程式或是call function等會直接執行完整支子程式
    不知道問題點->逐行執行找問題,確認問題不在這段code->execute
  • 3.return:跳出當前的函數或方法,返回上一層調用點
  • 4.continue:繼續執行直到下一個斷點或程式結束

如何建立斷點

https://ithelp.ithome.com.tw/upload/images/20240925/20169147AmFLlDpzH8.png
只要在程式碼左邊用滑鼠點左鍵就可以打上斷點,
這樣每次執行程式就會自動進入debug模式&停在斷點處

執行超過我要的語句或是想跳過特定段落不執行

https://ithelp.ithome.com.tw/upload/images/20240925/20169147Tp8wcQG93G.png
黃色是目前執行的語句,
這時只要對著上面的斷點按右鍵-> go to statement
就可以回到上面的斷點了,
同理如果想跳過一些code不執行就在想執行的那句打上斷點,
一樣按go to statement

查看參數的方法

只要對著程式上的參數點兩下,
右邊就會跳出參數還有他目前的值
https://ithelp.ithome.com.tw/upload/images/20240925/20169147hdzFpvZ8wV.png

https://ithelp.ithome.com.tw/upload/images/20240925/20169147Xx7zp62YBK.png
旁邊有鉛筆圖案的參數都可以做修改

以上就是今天的debug分享/images/emoticon/emoticon08.gif


上一篇
Day 10 RFC實例
下一篇
Day12 內表VS工作區VS結構 ! 一次搞懂內表怎麼玩
系列文
從0開始的ABAP之旅 12
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言